<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActiveSupport::TimeZone</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActiveSupport::TimeZone</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/rails/activesupport/lib/active_support/values/time_zone_rb.html">
                vendor/rails/activesupport/lib/active_support/values/time_zone.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000797">&lt;=&gt;</a>&nbsp;&nbsp;
      <a href="#M000798">=~</a>&nbsp;&nbsp;
      <a href="#M000812">[]</a>&nbsp;&nbsp;
      <a href="#M000811">all</a>&nbsp;&nbsp;
      <a href="#M000801">at</a>&nbsp;&nbsp;
      <a href="#M000796">formatted_offset</a>&nbsp;&nbsp;
      <a href="#M000800">local</a>&nbsp;&nbsp;
      <a href="#M000806">local_to_utc</a>&nbsp;&nbsp;
      <a href="#M000794">new</a>&nbsp;&nbsp;
      <a href="#M000810">new</a>&nbsp;&nbsp;
      <a href="#M000803">now</a>&nbsp;&nbsp;
      <a href="#M000802">parse</a>&nbsp;&nbsp;
      <a href="#M000808">period_for_local</a>&nbsp;&nbsp;
      <a href="#M000807">period_for_utc</a>&nbsp;&nbsp;
      <a href="#M000799">to_s</a>&nbsp;&nbsp;
      <a href="#M000804">today</a>&nbsp;&nbsp;
      <a href="#M000809">tzinfo</a>&nbsp;&nbsp;
      <a href="#M000813">us_zones</a>&nbsp;&nbsp;
      <a href="#M000795">utc_offset</a>&nbsp;&nbsp;
      <a href="#M000805">utc_to_local</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->
    <div id="includes">
      <h3 class="section-bar">Included Modules</h3>

      <div id="includes-list">
        <span class="include-name">Comparable</span>
      </div>
    </div>

    <div id="section">


    <div id="constants-list">
      <h3 class="section-bar">Constants</h3>

      <div class="name-list">
        <table summary="Constants">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">MAPPING</td>
          <td>=</td>
          <td class="context-item-value">{         &quot;International Date Line West&quot; =&gt; &quot;Pacific/Midway&quot;,         &quot;Midway Island&quot;                =&gt; &quot;Pacific/Midway&quot;,         &quot;Samoa&quot;                        =&gt; &quot;Pacific/Pago_Pago&quot;,         &quot;Hawaii&quot;                       =&gt; &quot;Pacific/Honolulu&quot;,         &quot;Alaska&quot;                       =&gt; &quot;America/Juneau&quot;,         &quot;Pacific Time (US &amp; Canada)&quot;   =&gt; &quot;America/Los_Angeles&quot;,         &quot;Tijuana&quot;                      =&gt; &quot;America/Tijuana&quot;,         &quot;Mountain Time (US &amp; Canada)&quot;  =&gt; &quot;America/Denver&quot;,         &quot;Arizona&quot;                      =&gt; &quot;America/Phoenix&quot;,         &quot;Chihuahua&quot;                    =&gt; &quot;America/Chihuahua&quot;,         &quot;Mazatlan&quot;                     =&gt; &quot;America/Mazatlan&quot;,         &quot;Central Time (US &amp; Canada)&quot;   =&gt; &quot;America/Chicago&quot;,         &quot;Saskatchewan&quot;                 =&gt; &quot;America/Regina&quot;,         &quot;Guadalajara&quot;                  =&gt; &quot;America/Mexico_City&quot;,         &quot;Mexico City&quot;                  =&gt; &quot;America/Mexico_City&quot;,         &quot;Monterrey&quot;                    =&gt; &quot;America/Monterrey&quot;,         &quot;Central America&quot;              =&gt; &quot;America/Guatemala&quot;,         &quot;Eastern Time (US &amp; Canada)&quot;   =&gt; &quot;America/New_York&quot;,         &quot;Indiana (East)&quot;               =&gt; &quot;America/Indiana/Indianapolis&quot;,         &quot;Bogota&quot;                       =&gt; &quot;America/Bogota&quot;,         &quot;Lima&quot;                         =&gt; &quot;America/Lima&quot;,         &quot;Quito&quot;                        =&gt; &quot;America/Lima&quot;,         &quot;Atlantic Time (Canada)&quot;       =&gt; &quot;America/Halifax&quot;,         &quot;Caracas&quot;                      =&gt; &quot;America/Caracas&quot;,         &quot;La Paz&quot;                       =&gt; &quot;America/La_Paz&quot;,         &quot;Santiago&quot;                     =&gt; &quot;America/Santiago&quot;,         &quot;Newfoundland&quot;                 =&gt; &quot;America/St_Johns&quot;,         &quot;Brasilia&quot;                     =&gt; &quot;America/Sao_Paulo&quot;,         &quot;Buenos Aires&quot;                 =&gt; &quot;America/Argentina/Buenos_Aires&quot;,         &quot;Georgetown&quot;                   =&gt; &quot;America/Argentina/San_Juan&quot;,         &quot;Greenland&quot;                    =&gt; &quot;America/Godthab&quot;,         &quot;Mid-Atlantic&quot;                 =&gt; &quot;Atlantic/South_Georgia&quot;,         &quot;Azores&quot;                       =&gt; &quot;Atlantic/Azores&quot;,         &quot;Cape Verde Is.&quot;               =&gt; &quot;Atlantic/Cape_Verde&quot;,         &quot;Dublin&quot;                       =&gt; &quot;Europe/Dublin&quot;,         &quot;Edinburgh&quot;                    =&gt; &quot;Europe/Dublin&quot;,         &quot;Lisbon&quot;                       =&gt; &quot;Europe/Lisbon&quot;,         &quot;London&quot;                       =&gt; &quot;Europe/London&quot;,         &quot;Casablanca&quot;                   =&gt; &quot;Africa/Casablanca&quot;,         &quot;Monrovia&quot;                     =&gt; &quot;Africa/Monrovia&quot;,         &quot;UTC&quot;                          =&gt; &quot;Etc/UTC&quot;,         &quot;Belgrade&quot;                     =&gt; &quot;Europe/Belgrade&quot;,         &quot;Bratislava&quot;                   =&gt; &quot;Europe/Bratislava&quot;,         &quot;Budapest&quot;                     =&gt; &quot;Europe/Budapest&quot;,         &quot;Ljubljana&quot;                    =&gt; &quot;Europe/Ljubljana&quot;,         &quot;Prague&quot;                       =&gt; &quot;Europe/Prague&quot;,         &quot;Sarajevo&quot;                     =&gt; &quot;Europe/Sarajevo&quot;,         &quot;Skopje&quot;                       =&gt; &quot;Europe/Skopje&quot;,         &quot;Warsaw&quot;                       =&gt; &quot;Europe/Warsaw&quot;,         &quot;Zagreb&quot;                       =&gt; &quot;Europe/Zagreb&quot;,         &quot;Brussels&quot;                     =&gt; &quot;Europe/Brussels&quot;,         &quot;Copenhagen&quot;                   =&gt; &quot;Europe/Copenhagen&quot;,         &quot;Madrid&quot;                       =&gt; &quot;Europe/Madrid&quot;,         &quot;Paris&quot;                        =&gt; &quot;Europe/Paris&quot;,         &quot;Amsterdam&quot;                    =&gt; &quot;Europe/Amsterdam&quot;,         &quot;Berlin&quot;                       =&gt; &quot;Europe/Berlin&quot;,         &quot;Bern&quot;                         =&gt; &quot;Europe/Berlin&quot;,         &quot;Rome&quot;                         =&gt; &quot;Europe/Rome&quot;,         &quot;Stockholm&quot;                    =&gt; &quot;Europe/Stockholm&quot;,         &quot;Vienna&quot;                       =&gt; &quot;Europe/Vienna&quot;,         &quot;West Central Africa&quot;          =&gt; &quot;Africa/Algiers&quot;,         &quot;Bucharest&quot;                    =&gt; &quot;Europe/Bucharest&quot;,         &quot;Cairo&quot;                        =&gt; &quot;Africa/Cairo&quot;,         &quot;Helsinki&quot;                     =&gt; &quot;Europe/Helsinki&quot;,         &quot;Kyev&quot;                         =&gt; &quot;Europe/Kiev&quot;,         &quot;Riga&quot;                         =&gt; &quot;Europe/Riga&quot;,         &quot;Sofia&quot;                        =&gt; &quot;Europe/Sofia&quot;,         &quot;Tallinn&quot;                      =&gt; &quot;Europe/Tallinn&quot;,         &quot;Vilnius&quot;                      =&gt; &quot;Europe/Vilnius&quot;,         &quot;Athens&quot;                       =&gt; &quot;Europe/Athens&quot;,         &quot;Istanbul&quot;                     =&gt; &quot;Europe/Istanbul&quot;,         &quot;Minsk&quot;                        =&gt; &quot;Europe/Minsk&quot;,         &quot;Jerusalem&quot;                    =&gt; &quot;Asia/Jerusalem&quot;,         &quot;Harare&quot;                       =&gt; &quot;Africa/Harare&quot;,         &quot;Pretoria&quot;                     =&gt; &quot;Africa/Johannesburg&quot;,         &quot;Moscow&quot;                       =&gt; &quot;Europe/Moscow&quot;,         &quot;St. Petersburg&quot;               =&gt; &quot;Europe/Moscow&quot;,         &quot;Volgograd&quot;                    =&gt; &quot;Europe/Moscow&quot;,         &quot;Kuwait&quot;                       =&gt; &quot;Asia/Kuwait&quot;,         &quot;Riyadh&quot;                       =&gt; &quot;Asia/Riyadh&quot;,         &quot;Nairobi&quot;                      =&gt; &quot;Africa/Nairobi&quot;,         &quot;Baghdad&quot;                      =&gt; &quot;Asia/Baghdad&quot;,         &quot;Tehran&quot;                       =&gt; &quot;Asia/Tehran&quot;,         &quot;Abu Dhabi&quot;                    =&gt; &quot;Asia/Muscat&quot;,         &quot;Muscat&quot;                       =&gt; &quot;Asia/Muscat&quot;,         &quot;Baku&quot;                         =&gt; &quot;Asia/Baku&quot;,         &quot;Tbilisi&quot;                      =&gt; &quot;Asia/Tbilisi&quot;,         &quot;Yerevan&quot;                      =&gt; &quot;Asia/Yerevan&quot;,         &quot;Kabul&quot;                        =&gt; &quot;Asia/Kabul&quot;,         &quot;Ekaterinburg&quot;                 =&gt; &quot;Asia/Yekaterinburg&quot;,         &quot;Islamabad&quot;                    =&gt; &quot;Asia/Karachi&quot;,         &quot;Karachi&quot;                      =&gt; &quot;Asia/Karachi&quot;,         &quot;Tashkent&quot;                     =&gt; &quot;Asia/Tashkent&quot;,         &quot;Chennai&quot;                      =&gt; &quot;Asia/Kolkata&quot;,         &quot;Kolkata&quot;                      =&gt; &quot;Asia/Kolkata&quot;,         &quot;Mumbai&quot;                       =&gt; &quot;Asia/Kolkata&quot;,         &quot;New Delhi&quot;                    =&gt; &quot;Asia/Kolkata&quot;,         &quot;Kathmandu&quot;                    =&gt; &quot;Asia/Katmandu&quot;,         &quot;Astana&quot;                       =&gt; &quot;Asia/Dhaka&quot;,         &quot;Dhaka&quot;                        =&gt; &quot;Asia/Dhaka&quot;,         &quot;Sri Jayawardenepura&quot;          =&gt; &quot;Asia/Colombo&quot;,         &quot;Almaty&quot;                       =&gt; &quot;Asia/Almaty&quot;,         &quot;Novosibirsk&quot;                  =&gt; &quot;Asia/Novosibirsk&quot;,         &quot;Rangoon&quot;                      =&gt; &quot;Asia/Rangoon&quot;,         &quot;Bangkok&quot;                      =&gt; &quot;Asia/Bangkok&quot;,         &quot;Hanoi&quot;                        =&gt; &quot;Asia/Bangkok&quot;,         &quot;Jakarta&quot;                      =&gt; &quot;Asia/Jakarta&quot;,         &quot;Krasnoyarsk&quot;                  =&gt; &quot;Asia/Krasnoyarsk&quot;,         &quot;Beijing&quot;                      =&gt; &quot;Asia/Shanghai&quot;,         &quot;Chongqing&quot;                    =&gt; &quot;Asia/Chongqing&quot;,         &quot;Hong Kong&quot;                    =&gt; &quot;Asia/Hong_Kong&quot;,         &quot;Urumqi&quot;                       =&gt; &quot;Asia/Urumqi&quot;,         &quot;Kuala Lumpur&quot;                 =&gt; &quot;Asia/Kuala_Lumpur&quot;,         &quot;Singapore&quot;                    =&gt; &quot;Asia/Singapore&quot;,         &quot;Taipei&quot;                       =&gt; &quot;Asia/Taipei&quot;,         &quot;Perth&quot;                        =&gt; &quot;Australia/Perth&quot;,         &quot;Irkutsk&quot;                      =&gt; &quot;Asia/Irkutsk&quot;,         &quot;Ulaan Bataar&quot;                 =&gt; &quot;Asia/Ulaanbaatar&quot;,         &quot;Seoul&quot;                        =&gt; &quot;Asia/Seoul&quot;,         &quot;Osaka&quot;                        =&gt; &quot;Asia/Tokyo&quot;,         &quot;Sapporo&quot;                      =&gt; &quot;Asia/Tokyo&quot;,         &quot;Tokyo&quot;                        =&gt; &quot;Asia/Tokyo&quot;,         &quot;Yakutsk&quot;                      =&gt; &quot;Asia/Yakutsk&quot;,         &quot;Darwin&quot;                       =&gt; &quot;Australia/Darwin&quot;,         &quot;Adelaide&quot;                     =&gt; &quot;Australia/Adelaide&quot;,         &quot;Canberra&quot;                     =&gt; &quot;Australia/Melbourne&quot;,         &quot;Melbourne&quot;                    =&gt; &quot;Australia/Melbourne&quot;,         &quot;Sydney&quot;                       =&gt; &quot;Australia/Sydney&quot;,         &quot;Brisbane&quot;                     =&gt; &quot;Australia/Brisbane&quot;,         &quot;Hobart&quot;                       =&gt; &quot;Australia/Hobart&quot;,         &quot;Vladivostok&quot;                  =&gt; &quot;Asia/Vladivostok&quot;,         &quot;Guam&quot;                         =&gt; &quot;Pacific/Guam&quot;,         &quot;Port Moresby&quot;                 =&gt; &quot;Pacific/Port_Moresby&quot;,         &quot;Magadan&quot;                      =&gt; &quot;Asia/Magadan&quot;,         &quot;Solomon Is.&quot;                  =&gt; &quot;Asia/Magadan&quot;,         &quot;New Caledonia&quot;                =&gt; &quot;Pacific/Noumea&quot;,         &quot;Fiji&quot;                         =&gt; &quot;Pacific/Fiji&quot;,         &quot;Kamchatka&quot;                    =&gt; &quot;Asia/Kamchatka&quot;,         &quot;Marshall Is.&quot;                 =&gt; &quot;Pacific/Majuro&quot;,         &quot;Auckland&quot;                     =&gt; &quot;Pacific/Auckland&quot;,         &quot;Wellington&quot;                   =&gt; &quot;Pacific/Auckland&quot;,         &quot;Nuku'alofa&quot;                   =&gt; &quot;Pacific/Tongatapu&quot;</td>
          <td width="3em">&nbsp;</td>
          <td class="context-item-desc">
Keys are <a href="../Rails.html">Rails</a> <a
href="TimeZone.html">TimeZone</a> names, values are <a
href="../TZInfo.html">TZInfo</a> identifiers

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">ZONES</td>
          <td>=</td>
          <td class="context-item-value">[]</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">ZONES_MAP</td>
          <td>=</td>
          <td class="context-item-value">{}</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">US_ZONES</td>
          <td>=</td>
          <td class="context-item-value">ZONES.find_all { |z| z.name =~ /US|Arizona|Indiana|Hawaii|Alaska/ }</td>
        </tr>
        </table>
      </div>
    </div>

    <div id="aliases-list">
      <h3 class="section-bar">External Aliases</h3>

      <div class="name-list">
                        <table summary="aliases">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">new</td>
          <td>-&gt;</td>
          <td class="context-item-value">create</td>
        </tr>
                        </table>
      </div>
    </div>


    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">name</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000812" class="method-detail">
        <a name="M000812"></a>

        <div class="method-heading">
          <a href="#M000812" class="method-signature">
          <span class="method-name">[]</span><span class="method-args">(arg)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Locate a specific time zone object. If the argument is a string, it is
interpreted to mean the name of the timezone to locate. If it is a numeric
value it is either the hour offset, or the second offset, of the timezone
to find. (The first one with that offset will be returned.) Returns
<tt>nil</tt> if no such time zone is known to the system.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000812-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000812-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 384</span>
384:       <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-identifier">arg</span>)
385:         <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">arg</span>
386:           <span class="ruby-keyword kw">when</span> <span class="ruby-constant">String</span>
387:             <span class="ruby-constant">ZONES_MAP</span>[<span class="ruby-identifier">arg</span>]
388:           <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Numeric</span>, <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">Duration</span>
389:             <span class="ruby-identifier">arg</span> <span class="ruby-operator">*=</span> <span class="ruby-value">3600</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">abs</span> <span class="ruby-operator">&lt;=</span> <span class="ruby-value">13</span>
390:             <span class="ruby-identifier">all</span>.<span class="ruby-identifier">find</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">z</span><span class="ruby-operator">|</span> <span class="ruby-identifier">z</span>.<span class="ruby-identifier">utc_offset</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">to_i</span> }
391:           <span class="ruby-keyword kw">else</span>
392:             <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;invalid argument to TimeZone[]: #{arg.inspect}&quot;</span>
393:         <span class="ruby-keyword kw">end</span>
394:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000811" class="method-detail">
        <a name="M000811"></a>

        <div class="method-heading">
          <a href="#M000811" class="method-signature">
          <span class="method-name">all</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Return an array of <a href="TimeZone.html#M000811">all</a> <a
href="TimeZone.html">TimeZone</a> objects. There are multiple <a
href="TimeZone.html">TimeZone</a> objects per time zone, in many cases, to
make it easier for users to find their own time zone.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000811-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000811-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 375</span>
375:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">all</span>
376:         <span class="ruby-constant">ZONES</span>
377:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000794" class="method-detail">
        <a name="M000794"></a>

        <div class="method-heading">
          <a href="#M000794" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(name, utc_offset, tzinfo = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Create a <a href="TimeZone.html#M000794">new</a> <a
href="TimeZone.html">TimeZone</a> object with the given name and offset.
The offset is the number of seconds that this time zone is offset from UTC
(GMT). Seconds were chosen as the offset unit because that is the unit that
Ruby uses to represent time zone offsets (see Time#utc_offset).
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000794-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000794-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 180</span>
180:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">utc_offset</span>, <span class="ruby-identifier">tzinfo</span> = <span class="ruby-keyword kw">nil</span>)
181:       <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
182:       <span class="ruby-ivar">@utc_offset</span> = <span class="ruby-identifier">utc_offset</span>
183:       <span class="ruby-ivar">@tzinfo</span> = <span class="ruby-identifier">tzinfo</span>
184:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000810" class="method-detail">
        <a name="M000810"></a>

        <div class="method-heading">
          <a href="#M000810" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Return a <a href="TimeZone.html">TimeZone</a> instance with the given name,
or <tt>nil</tt> if no such <a href="TimeZone.html">TimeZone</a> instance
exists. (This exists to support the use of this class with the
<tt>composed_of</tt> macro.)
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000810-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000810-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 368</span>
368:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>)
369:         <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">name</span>]
370:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000813" class="method-detail">
        <a name="M000813"></a>

        <div class="method-heading">
          <a href="#M000813" class="method-signature">
          <span class="method-name">us_zones</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
A convenience method for returning a collection of <a
href="TimeZone.html">TimeZone</a> objects for time zones in the USA.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000813-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000813-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 398</span>
398:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">us_zones</span>
399:         <span class="ruby-constant">US_ZONES</span>
400:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000797" class="method-detail">
        <a name="M000797"></a>

        <div class="method-heading">
          <a href="#M000797" class="method-signature">
          <span class="method-name">&lt;=&gt;</span><span class="method-args">(zone)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Compare this time zone to the parameter. The two are comapred first on
their offsets, and then by name.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000797-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000797-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 198</span>
198:     <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;=&gt;</span>(<span class="ruby-identifier">zone</span>)
199:       <span class="ruby-identifier">result</span> = (<span class="ruby-identifier">utc_offset</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">zone</span>.<span class="ruby-identifier">utc_offset</span>)
200:       <span class="ruby-identifier">result</span> = (<span class="ruby-identifier">name</span> <span class="ruby-operator">&lt;=&gt;</span> <span class="ruby-identifier">zone</span>.<span class="ruby-identifier">name</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
201:       <span class="ruby-identifier">result</span>
202:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000798" class="method-detail">
        <a name="M000798"></a>

        <div class="method-heading">
          <a href="#M000798" class="method-signature">
          <span class="method-name">=~</span><span class="method-args">(re)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Compare name and <a href="../TZInfo.html">TZInfo</a> identifier to a
supplied regexp, returning true if a match is found.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000798-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000798-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 206</span>
206:     <span class="ruby-keyword kw">def</span> <span class="ruby-operator">=~</span>(<span class="ruby-identifier">re</span>)
207:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">re</span> <span class="ruby-operator">||</span> <span class="ruby-constant">MAPPING</span>[<span class="ruby-identifier">name</span>] <span class="ruby-operator">=~</span> <span class="ruby-identifier">re</span>
208:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000801" class="method-detail">
        <a name="M000801"></a>

        <div class="method-heading">
          <a href="#M000801" class="method-signature">
          <span class="method-name">at</span><span class="method-args">(secs)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Method for creating <a href="TimeZone.html#M000794">new</a> <a
href="TimeWithZone.html">ActiveSupport::TimeWithZone</a> instance in time
zone of <tt>self</tt> from number of seconds since the Unix epoch. Example:
</p>
<pre>
  Time.zone = &quot;Hawaii&quot;        # =&gt; &quot;Hawaii&quot;
  Time.utc(2000).to_f         # =&gt; 946684800.0
  Time.zone.at(946684800.0)   # =&gt; Fri, 31 Dec 1999 14:00:00 HST -10:00
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000801-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000801-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 229</span>
229:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">at</span>(<span class="ruby-identifier">secs</span>)
230:       <span class="ruby-identifier">utc</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">at</span>(<span class="ruby-identifier">secs</span>).<span class="ruby-identifier">utc</span> <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">civil</span>(<span class="ruby-value">1970</span>).<span class="ruby-identifier">since</span>(<span class="ruby-identifier">secs</span>)
231:       <span class="ruby-identifier">utc</span>.<span class="ruby-identifier">in_time_zone</span>(<span class="ruby-keyword kw">self</span>)
232:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000796" class="method-detail">
        <a name="M000796"></a>

        <div class="method-heading">
          <a href="#M000796" class="method-signature">
          <span class="method-name">formatted_offset</span><span class="method-args">(colon=true, alternate_utc_string = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the offset of this time zone as a formatted string, of the format
&quot;+HH:MM&quot;.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000796-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000796-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 192</span>
192:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">formatted_offset</span>(<span class="ruby-identifier">colon</span>=<span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">alternate_utc_string</span> = <span class="ruby-keyword kw">nil</span>)
193:       <span class="ruby-identifier">utc_offset</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">alternate_utc_string</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">utc_offset</span>.<span class="ruby-identifier">to_utc_offset_s</span>(<span class="ruby-identifier">colon</span>)
194:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000800" class="method-detail">
        <a name="M000800"></a>

        <div class="method-heading">
          <a href="#M000800" class="method-signature">
          <span class="method-name">local</span><span class="method-args">(*args)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Method for creating <a href="TimeZone.html#M000794">new</a> <a
href="TimeWithZone.html">ActiveSupport::TimeWithZone</a> instance in time
zone of <tt>self</tt> from given values. Example:
</p>
<pre>
  Time.zone = &quot;Hawaii&quot;                      # =&gt; &quot;Hawaii&quot;
  Time.zone.local(2007, 2, 1, 15, 30, 45)   # =&gt; Thu, 01 Feb 2007 15:30:45 HST -10:00
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000800-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000800-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 219</span>
219:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">local</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
220:       <span class="ruby-identifier">time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">utc_time</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
221:       <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">TimeWithZone</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">time</span>)
222:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000806" class="method-detail">
        <a name="M000806"></a>

        <div class="method-heading">
          <a href="#M000806" class="method-signature">
          <span class="method-name">local_to_utc</span><span class="method-args">(time, dst=true)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Adjust the given time to the simultaneous time in UTC. Returns a Time.utc()
instance.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000806-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000806-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 275</span>
275:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">local_to_utc</span>(<span class="ruby-identifier">time</span>, <span class="ruby-identifier">dst</span>=<span class="ruby-keyword kw">true</span>)
276:       <span class="ruby-identifier">tzinfo</span>.<span class="ruby-identifier">local_to_utc</span>(<span class="ruby-identifier">time</span>, <span class="ruby-identifier">dst</span>)
277:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000803" class="method-detail">
        <a name="M000803"></a>

        <div class="method-heading">
          <a href="#M000803" class="method-signature">
          <span class="method-name">now</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns an <a href="TimeWithZone.html">ActiveSupport::TimeWithZone</a>
instance representing the current time in the time zone represented by
<tt>self</tt>. Example:
</p>
<pre>
  Time.zone = 'Hawaii'  # =&gt; &quot;Hawaii&quot;
  Time.zone.now         # =&gt; Wed, 23 Jan 2008 20:24:27 HST -10:00
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000803-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000803-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 259</span>
259:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">now</span>
260:       <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">utc</span>.<span class="ruby-identifier">in_time_zone</span>(<span class="ruby-keyword kw">self</span>)
261:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000802" class="method-detail">
        <a name="M000802"></a>

        <div class="method-heading">
          <a href="#M000802" class="method-signature">
          <span class="method-name">parse</span><span class="method-args">(str, now=now)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Method for creating <a href="TimeZone.html#M000794">new</a> <a
href="TimeWithZone.html">ActiveSupport::TimeWithZone</a> instance in time
zone of <tt>self</tt> from parsed string. Example:
</p>
<pre>
  Time.zone = &quot;Hawaii&quot;                      # =&gt; &quot;Hawaii&quot;
  Time.zone.parse('1999-12-31 14:00:00')    # =&gt; Fri, 31 Dec 1999 14:00:00 HST -10:00
</pre>
<p>
If upper components are missing from the string, they are supplied from <a
href="TimeZone.html#M000803">TimeZone#now</a>:
</p>
<pre>
  Time.zone.now                 # =&gt; Fri, 31 Dec 1999 14:00:00 HST -10:00
  Time.zone.parse('22:30:00')   # =&gt; Fri, 31 Dec 1999 22:30:00 HST -10:00
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000802-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000802-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 243</span>
243:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">now</span>=<span class="ruby-identifier">now</span>)
244:       <span class="ruby-identifier">date_parts</span> = <span class="ruby-constant">Date</span>.<span class="ruby-identifier">_parse</span>(<span class="ruby-identifier">str</span>)
245:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">date_parts</span>.<span class="ruby-identifier">blank?</span>
246:       <span class="ruby-identifier">time</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">now</span>) <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">str</span>)
247:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">date_parts</span>[<span class="ruby-identifier">:offset</span>].<span class="ruby-identifier">nil?</span>
248:         <span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">TimeWithZone</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">time</span>)
249:       <span class="ruby-keyword kw">else</span>
250:         <span class="ruby-identifier">time</span>.<span class="ruby-identifier">in_time_zone</span>(<span class="ruby-keyword kw">self</span>)
251:       <span class="ruby-keyword kw">end</span>
252:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000808" class="method-detail">
        <a name="M000808"></a>

        <div class="method-heading">
          <a href="#M000808" class="method-signature">
          <span class="method-name">period_for_local</span><span class="method-args">(time, dst=true)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Available so that <a href="TimeZone.html">TimeZone</a> instances respond
like <a href="../TZInfo/Timezone.html">TZInfo::Timezone</a> instances
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000808-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000808-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 285</span>
285:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">period_for_local</span>(<span class="ruby-identifier">time</span>, <span class="ruby-identifier">dst</span>=<span class="ruby-keyword kw">true</span>)
286:       <span class="ruby-identifier">tzinfo</span>.<span class="ruby-identifier">period_for_local</span>(<span class="ruby-identifier">time</span>, <span class="ruby-identifier">dst</span>)
287:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000807" class="method-detail">
        <a name="M000807"></a>

        <div class="method-heading">
          <a href="#M000807" class="method-signature">
          <span class="method-name">period_for_utc</span><span class="method-args">(time)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Available so that <a href="TimeZone.html">TimeZone</a> instances respond
like <a href="../TZInfo/Timezone.html">TZInfo::Timezone</a> instances
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000807-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000807-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 280</span>
280:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">period_for_utc</span>(<span class="ruby-identifier">time</span>)
281:       <span class="ruby-identifier">tzinfo</span>.<span class="ruby-identifier">period_for_utc</span>(<span class="ruby-identifier">time</span>)
282:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000799" class="method-detail">
        <a name="M000799"></a>

        <div class="method-heading">
          <a href="#M000799" class="method-signature">
          <span class="method-name">to_s</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns a textual representation of this time zone.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000799-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000799-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 211</span>
211:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
212:       <span class="ruby-node">&quot;(GMT#{formatted_offset}) #{name}&quot;</span>
213:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000804" class="method-detail">
        <a name="M000804"></a>

        <div class="method-heading">
          <a href="#M000804" class="method-signature">
          <span class="method-name">today</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Return the current date in this time zone.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000804-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000804-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 264</span>
264:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">today</span>
265:       <span class="ruby-identifier">tzinfo</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_date</span>
266:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000809" class="method-detail">
        <a name="M000809"></a>

        <div class="method-heading">
          <a href="#M000809" class="method-signature">
          <span class="method-name">tzinfo</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
TODO: Preload instead of lazy load for thread safety
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000809-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000809-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 290</span>
290:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tzinfo</span>
291:       <span class="ruby-ivar">@tzinfo</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">TZInfo</span><span class="ruby-operator">::</span><span class="ruby-constant">Timezone</span>.<span class="ruby-identifier">get</span>(<span class="ruby-constant">MAPPING</span>[<span class="ruby-identifier">name</span>])
292:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000795" class="method-detail">
        <a name="M000795"></a>

        <div class="method-heading">
          <a href="#M000795" class="method-signature">
          <span class="method-name">utc_offset</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000795-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000795-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 186</span>
186:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">utc_offset</span>
187:       <span class="ruby-ivar">@utc_offset</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">tzinfo</span>.<span class="ruby-identifier">current_period</span>.<span class="ruby-identifier">utc_offset</span>
188:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000805" class="method-detail">
        <a name="M000805"></a>

        <div class="method-heading">
          <a href="#M000805" class="method-signature">
          <span class="method-name">utc_to_local</span><span class="method-args">(time)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Adjust the given time to the simultaneous time in the time zone represented
by <tt>self</tt>. Returns a Time.utc() instance &#8212; if you want an <a
href="TimeWithZone.html">ActiveSupport::TimeWithZone</a> instance, use
Time#in_time_zone() instead.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000805-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000805-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/activesupport/lib/active_support/values/time_zone.rb, line 270</span>
270:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">utc_to_local</span>(<span class="ruby-identifier">time</span>)
271:       <span class="ruby-identifier">tzinfo</span>.<span class="ruby-identifier">utc_to_local</span>(<span class="ruby-identifier">time</span>)
272:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>